<?php 
// dojo helper
$this->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
$this->dojo()->enable()->requireModule('dijit.Tooltip');
$this->headScript()->captureStart();
?>
dojo.addOnLoad(function() {
	priceTooltip = new dijit.Tooltip({
		connectId: ["priceTooltip"],
		label: "Alle Preisangaben sind Durschnittspreise."
	});
	caloriesTooltip = new dijit.Tooltip({
		connectId: ["caloriesTooltip"],
		label: "Kalorienangaben pro 100 g bzw. 100 ml"
	});
});
<?php $this->headScript()->captureEnd(); ?>
<div class="content">
<h2>Zutaten für Cocktailrezepte</h2>
<table class="table">
	<thead>
		<tr>
			<th>Zutat &amp; Alkoholgehalt</th>
			<th>Kategorie</th>
			<th><a href="#" class="tip pink" id="caloriesTooltip">Kalorien</a> &amp; <a href="#" class="tip pink" id="priceTooltip">Preis</a></th>
			<th>Rezepte/ Produkte</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach ($this->ingredients as $ingredient){ /* @var $ingredient Website_Model_Ingredient */ ?>
		<tr>
			<td><?php 
			$categories = '';
			if(is_array($ingredient->getIngredientCategories())){
				foreach($ingredient->getIngredientCategories() as $cagetory){
					$cagetory = '<a href="'.$this->url(array('controller'=>'ingredient-category','action'=>'get','module'=>'website','id'=>$cagetory->getUniqueName()),'rest',true).'">'.$cagetory->name.'</a>';
					$categories	= ($categories ? $categories.', '.$cagetory : $cagetory);
				}
			} ?> <a
				href="<?php print $this->url(array('controller'=>'ingredient','action'=>'get','module'=>'website','id'=>$ingredient->getUniqueName()),'ingredient',true); ?>">
				<?php print $ingredient->name; ?></a><br />
				<?php if($ingredient->getAverageAlcoholLevel()) { print $ingredient->getAverageAlcoholLevel().' %'; } else { print '0 %'; } ?></td>
			<td><?php print $categories; ?></td>
			<td><?php if($ingredient->getAverageCaloriesKcal()) { print round($ingredient->getAverageCaloriesKcal()/10); ?>&nbsp;kcal<?php } else { print 'k.A.'; } ?><br />
			<?php 
			if($ingredient->getAveragePricePerLitre() || $ingredient->getAveragePricePerKilogram()) {
				if($ingredient->getAveragePricePerLitre()) {
					print number_format($ingredient->getAveragePricePerLitre(),2,',','.').'&nbsp;€&nbsp;/&nbsp;l ';
				}
				if($ingredient->getAveragePricePerLitre() && $ingredient->getAveragePricePerKilogram()) {
					print ' bzw. ';
				}
				if($ingredient->getAveragePricePerKilogram()) {
					print number_format($ingredient->getAveragePricePerKilogram(),2,',','.').'&nbsp;€&nbsp;/&nbsp;kg';
				}
			} ?></td>
			<td><?php 
			$numberOfRecipes = $ingredient->getNumberOfRecipes();
			if($numberOfRecipes) { ?>
				<a href="<?php print $this->url(array(
				'controller'=>'ingredient','action'=>'get','module'=>'website',
				'id'=>$ingredient->getUniqueName()),'ingredient',true); ?>#recipes-list">
				<?php print $numberOfRecipes; ?> Stk.</a><?php
			} else { ?>keine<?php } 
			?> /<br />
			<?php 
			$products = Website_Model_Product::numberOfProductsByIngredientId($ingredient->id);
			if($products>0) { ?><a href="<?php print $this->url(array(
				'controller'=>'ingredient','action'=>'get','module'=>'website',
				'id'=>$ingredient->getUniqueName()),'ingredient',true); ?>#products-list"><?php print $products; ?>
				Stk.</a><?php 
			} ?></td>
		</tr>
		<?php } ?>
	</tbody>
</table>
</div>